perm filename MOPFUN.1[CLS,LSP] blob
sn#847462 filedate 1987-10-26 generic text, type T, neo UTF8
\input macros
\drafttrue
\def\bookline{\CLOS\ Specification}
\def\chapline{Functions in the Meta-Object Protocol}
\beginChapter 3.{Common Lisp Object System Specification}%
{Functions in the Meta-Object Protocol}{Functions in the Meta-Object Protocol}
This document was written by Daniel G. Bobrow, Linda G. DeMichiel,\break
Richard P. Gabriel, Sonya E. Keene, Gregor Kiczales, and David A. Moon.
Contributors to this document include Patrick Dussud, Kenneth Kahn,\break
Jim Kempf, Larry Masinter, Mark Stefik,
Daniel L. Weinreb, and Jon L White.
\endTitlePage
\beginSection{Introduction}
This chapter describes some of the functions provided by the \CLOS\
Meta-Object Protocol. This document is preliminary; it is not to
be construed as presenting a complete description of Meta-Object
Protocol.
The description of each function includes its purpose, its syntax, the
semantics of its arguments and returned values, and often an example
and cross-references to related functions. This chapter is reference
material that requires an understanding of the basic concepts of the
Common Lisp Object System. The functions are arranged in alphabetic
order for convenient reference.
\endSection%{Introduction}
\begincom{allocate-instance}\ftype{Generic Function}
\label Purpose:
The generic function {\bf allocate-instance} allocates storage for an instance
of the given class.
\label Syntax:
\Defgen {allocate-instance} {class\/ {\key \&allow-other-keys}}
\label Arguments:
The {\it class\/} argument is a class object.
\label Values:
The result is the newly-allocated instance.
\label Remarks:
The keyword name of each keyword parameter specifier in the lambda-list
of any method defined for {\bf allocate-instance} becomes an initialization
argument for all classes for which that method is applicable.
Programmers can customize the behavior {\bf allocate-instance} by
defining additional methods for it or replacing the system-supplied
default method.
\label See Also:
``Object Creation and Initialization''
\endcom
\begincom{check-initargs}\ftype{Generic Function}
\label Purpose:
The generic function {\bf check-initargs} is called by {\bf make-instance}
to test the validity of initialization arguments.
The system-supplied default method implements the rules for validity
described in the section ``Object Creation and Initialization.''
\label Syntax:
\Defgen {check-initargs} {class initarg-list}
\label Arguments:
The {\it class\/} argument is a class object.
The {\it initarg-list\/} argument is an initialization argument list.
\label Values:
The result is an initialization argument list.
\label Remarks:
Programmers can customize the behavior {\bf check-initargs} by
defining additional methods for it or by replacing the system-supplied
default method.
\label See Also:
``Object Creation and Initialization''
\endcom
\begincom{class-all-initargs}\ftype{Generic Function}
\label Purpose:
The generic function {\bf class-all-initargs} returns a list of the names of
all initialization arguments that apply to a given class, including
the names of inherited initialization arguments.
This result is the set of all the initialization argument names obtained
by applying {\bf class-direct-initargs} to the given calss and all of its
superclasses.
\label Syntax:
\Defgen {class-all-initargs} {class}
\label Arguments:
The {\it class argument\/} is a class object.
\label Values:
The result is a list of the names of all initargs that apply to a
given class, including the name of inherited initargs.
\label Remarks:
The results are undefined if the values returned by this function are
modified.
It is permitted, but not required, for an implementation to return values
that share with internal data structures.
\label See Also:
``Object Creation and Initialization''
{\bf make-instance
initialize-instance}
\endcom
\begincom{class-all-initarg-defaults}\ftype{Generic Function}
\label Purpose:
The generic function {\bf class-all-initarg-defaults} returns a list,
each of whose elements is a list consisting of the name of an
initialization argument defined for a slot in that class or any of its
superclasses followed by the default value function and the default
value form for that initialization argument. The default value
function is the function whose body is the default value form; this
function is created in the lexical environment of the {\bf defclass}
form that contains the default value form.
\label Syntax:
\Defgen {class-all-initarg-defaults} {class}
\label Arguments:
The {\it class\/} argument is a class object.
\label Values:
The result is a list of the form {\tt (({\it initialization-argument-name default-value-function default-value-form\/}) $\ldots$ )}.
\label Remarks:
The results are undefined if the values returned by this function are
modified.
It is permitted, but not required, for an implementation to return values
that share with internal data structures.
%\label See Also:
\endcom
\begincom{class-all-slot-initargs}\ftype{Generic Function}
\label Purpose:
The generic function {\bf class-all-slot-initargs} returns a list,
each of whose elements is a list consisting of the name of an
initialization argument defined for a slot in that class or any of its
superclasses followed by the name of all slots defined in the {\bf
defclass} forms for that class or any of its superclasses for which
that initialization argument is defined.
\label Syntax:
\Defgen {class-all-slot-initargs} {class}
\label Arguments:
The {\it class\/} argument is a class object.
\label Values:
The result is a list of the form {\tt (({\it
initialization-argument-name slot-name} $\ldots$) $\ldots$ )}.
\label Remarks:
The results are undefined if the values returned by this function are
modified.
It is permitted, but not required, for an implementation to return values
that share with internal data structures.
%\label See Also:
\endcom
\begincom{class-direct-initargs}\ftype{Generic Function}
\label Purpose:
The generic function {\bf class-direct-initargs} returns a list of the names
of all initialization arguments corresponding to a given class. These
initialization arguments include those that were specified using the
{\bf :initarg} slot option in the {\bf defclass form} for the given
class, as well as those that defined in the lambda-lists for methods on
{\bf allocate-instance} and {\bf initialize-instance} that are defined for
the exact given class.
\label Syntax:
\Defgen {class-direct-initargs} {class}
\label Arguments:
The {\it class\/} argument is a class object.
\label Values:
The result is a list of initialization argument names.
\label Remarks:
The results are undefined if the values returned by this function are
modified.
It is permitted, but not required, for an implementation to return values
that share with internal data structures.
\label See Also:
``Object Creation and Initialization''
{\bf make-instance
allocate-instance
initialize-instance}
\endcom
\begincom{class-direct-initarg-defaults}\ftype{Generic Function}
\label Purpose:
The generic function {\bf class-direct-initarg-defaults} returns a list,
each of whose elements is a list consisting of the name of an
initialization argument defined for a slot in that exact class followed by
the default value function and the default value form for that initialization
argument. The default value function is the function whose body is the
default value form; this function is created in the lexical environment of
the {\bf defclass} form that contains the default value form.
\label Syntax:
\Defgen {class-direct-initarg-defaults} {class}
\label Arguments:
The {\it class\/} argument is a class object.
\label Values:
The result is a list of the form {\tt (({\it initialization-argument-name default-value-function default-value-form\/}) $\ldots$ )}.
\label Remarks:
The results are undefined if the values returned by this function are
modified.
It is permitted, but not required, for an implementation to return values
that share with internal data structures.
%\label See Also:
\endcom
\begincom{class-direct-slot-initargs}\ftype{Generic Function}
\label Purpose:
The generic function {\bf class-direct-slot-initargs} returns a list,
each of whose elements is a list consisting of the name of an
initialization argument defined for a slot in that exact class followed by
the name of all slots defined in the {\bf defclass} form for that
class for which that initialization argument is defined.
\label Syntax:
\Defgen {class-direct-slot-initargs} {class}
\label Arguments:
The {\it class\/} argument is a class object.
\label Values:
The result is a list of the form {\tt (({\it
initialization-argument-name slot-name} $\ldots$) $\ldots$ )}.
\label Remarks:
The results are undefined if the values returned by this function are
modified.
It is permitted, but not required, for an implementation to return values
that share with internal data structures.
%\label See Also:
\endcom
\begincom{compute-applicable-methods}\ftype{Generic Function}
\label Purpose:
The generic function {\bf compute-applicable-methods} returns a list
of the methods of the generic function that are applicable for the
given arguments.
\label Syntax:
\Defgen {compute-applicable-methods} {generic-function argument-list}
\label Arguments:
The {\it generic-function\/} argument is a generic function object.
The {\it argument-list\/} argument is the argument list for that
generic function for which the applicable methods are to be
determined.
\label Values:
The result is a list of method objects.
%\label Remarks:
%\label See Also:
\endcom
\begincom{default-initargs}\ftype{Generic Function}
\label Purpose:
The system-supplied method for {\bf default-initargs} implements the
{\bf :default-initarg} class option by appending initialization arguments
that do not appear in the {\it initarg-list\/} argument to the
{\it initarg-list\/} argument and returning the result.
The order of the initialization arguments appended to the list is determined
by the rules for duplicate initialization arguments presented in the
section ``Rules for Duplication of Initialization Arguments.''
The {\it initarg-list\/} argument is not modified.
\label Syntax:
\Defgen {default-initargs} {class initarg-list}
\label Arguments:
The {\it class\/} argument is a class object.
The {\it initarg-list\/} argument is an initialization
argument list.
\label Values:
The result is an initialization argument list.
\label Remarks:
Programmers can customize the behavior {\bf default-initargs} by
defining additional methods for it or replacing the system-supplied
default method.
\label See Also:
``Object Creation and Initialization''
``Rules for Duplication of Initialization Arguments''
\endcom
\begincom{finalize-inheritance}\ftype{Generic Function}
\label Purpose:
[This page needs to be rewritten and made more precise.]
The generic function {\bf finalize-inheritance} is called at least once
before a class is instantiated and is called again whenever anything
relevant changes. [We need a more precise statement here.]
The system-supplied methods for {\bf finalize-inheritance} conspire with
methods for {\bf check-initargs} and other functions [?] to make
{\bf make-instance} faster.
\label Syntax:
\Defgen {finalize-inheritance} {class\/ {\key :slots :methods :initargs}}
\label Arguments:
The {\it class\/} argument is a class object [or the name of a class?].
The {\bf :slots}, {\bf :methods}, and {\bf :initargs} arguments are
boolean values that are true whenthe specified type of inheritance
needs to be recomputed.
\label Values:
[???]
\label Remarks:
Users with special optimization needs can write methods for {\bf finalize-inheritance} to precompute things [??] based on inherited information and to update
the precomputed information whenever anything [??] changes.
\label See Also:
{\bf make-instance
check-initargs}
\endcom
\begincom{method-keyword-names}\ftype{Generic Function}
\label Purpose:
The generic function {\bf method-keyword-names} returns a list of symbols
indicating the keywords names of the keyword parameter specificers in
the given method's lambda-list. The result is the symbol {\bf
\&allow-other-keys} instand of a list if the method's lambda-list
contains that symbol.
\label Syntax:
\Defgen {method-keyword-names} {method}
\label Arguments:
The {\it method\/} argument is a method object.
\label Values:
The result is a list of symbols or the symbol {\bf
\&allow-other-keys}.
%\label Remarks:
%\label See Also:
\endcom
\begincom{slot-boundp-using-class}\ftype{Generic Function}
\label Purpose:
The function {\bf slot-boundp-using-class} tests whether a specific slot in an
instance of a given class is bound.
\label Syntax:
\Defgen {slot-boundp-using-class} {class instance slot-name}
\label Arguments:
The arguments are the class of the instance, the instance itself, and
the name of the slot. The {\it class\/} argument is a class object.
\label Values:
The generic function {\bf slot-boundp-using-class} returns true or false.
%\label Remarks:
\label See Also:
{\bf slot-boundp}
\endcom
\begincom{slot-makunbound-using-class}\ftype{Generic Function}
\label Purpose:
The generic function {\bf slot-makunbound-using-class} restores a slot
in an instance to the uninitialized state.
\label Syntax:
\Defgen {slot-makunbound-using-class} {class instance slot-name}
\label Arguments:
The arguments are the class of the instance, the instance itself, and
the name of the slot. The {\it class\/} argument is a class object.
\label Values:
The instance is returned as the result.
%\label Remarks:
\label See Also:
{\bf slot-makunbound}
\endcom
\begincom{slot-value-using-class}\ftype{Generic Function}
\label Purpose:
The generic function {\bf slot-value-using-class} returns the value
contained in the slot {\it slot-name\/} of the given object of the
given class. If there is no slot with that name, an error is
signaled.
The macro {\bf setf} can be used with {\bf slot-value-using-class} to
change the value of a slot.
\label Syntax:
\Defgen {slot-value-using-class} {class object slot-name}
\label Arguments:
The arguments are the class of the object, the object itself, and
the name of the slot. The {\it class\/} argument is a class object.
\label Values:
The result is the value contained in the given slot.
\label See Also:
{\bf slot-value}
\endcom
\endChapter
\bye